// const myHeading = document.querySelector("h1");
// myHeading.textContent = "Hello World";
const myimage = document.querySelector("img");
myimage.onclick = () => {
    const mysrc = myimage.getAttribute("src");
    if (mysrc = "11.jpg") {
        myimage.setAttribute("src", "shanda2.jpg");
    }
    else {
        myimage.setAttribute("src", "shanda1.jpg");
    }

    let myButton = document.querySelector("button");
    let myHeading = document.querySelector("h1");

    function setUserName() {
        const myName = prompt("Please enter your name.");
        localStorage.setItem("name", myName);
        myHeading.textContent = `杉达, ${myName}`;
    }

    if (!localStorage.getItem("name")) {
        setUserName();
    } else {
        const storedName = localStorage.getItem("name");
        myHeading.textContent = `杉达, ${storedName}`;
    }
}